Ensure flake8 actually lints pull requests#1290
Merged
Merged
Conversation
We're in the process of migrating snekbox to the GitHub Container Repository, which will replace DockerHub. I've changed docker-compose to reflect that change. Signed-off-by: Sebastiaan Zeeff <sebastiaan.zeeff@gmail.com>
Unfortunately, our old setup did not actually lint the PR, as it was running in the context of the target repository. To sidestep the issue of using `pull_request_target` altogether, I've now changed our run of flake8 to using it directly and having it output its errors in teh format of Workflow Commands. This means that our flake8 output will not be translated automatically in annotations for the run. In addition, I've split up the workflow into two separate files: one for linting & testing and one for building (& deploying). Signed-off-by: Sebastiaan Zeeff <sebastiaan.zeeff@gmail.com>
Signed-off-by: Sebastiaan Zeeff <sebastiaan.zeeff@gmail.com>
Signed-off-by: Sebastiaan Zeeff <sebastiaan.zeeff@gmail.com>
472e6ea to
6b07eb1
Compare
lemonsaurus
approved these changes
Nov 18, 2020
Contributor
lemonsaurus
left a comment
There was a problem hiding this comment.
This is gorgeous. Can you document buildx? After that it's good to go, I think.
MarkKoz
approved these changes
Nov 18, 2020
It's better to document these steps. Signed-off-by: Sebastiaan Zeeff <sebastiaan.zeeff@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unfortunately, the way I'd configured our workflow meant that flake8 was running in the context of the target repository, which means it was linting our master branch without the changes introduced by the PR. This is obviously a bit useless when it comes to guarding our codebase from linting errors. That's why I've changed the way we run
flake8.I've also decided to split the workflow file in two separate ones: one to lint/test and one to build/deploy.
Finally, I've updated the docker-compose file to use GHCR for pulling snekbox images. This should already work, although it's probably best if we wait until merging python-discord/snekbox#79.